// 涉及到用户的所有接口都在这里进行封装
import Ajax from './ajax'

/**
 * 获取验证码
 * @param {String} phone 手机号码
 */
const getvdtCode = phone => {
    return Ajax({
        url: '/user/validate/code',
        method: 'POST',
        data: {phone}
    })
}
				
const userLogin=(phone,vdtCode)=>{
    return Ajax({
        url:'/user/app/login',
        method:'POST',
        data:{phone,vdtCode}
    })
}

const getUserInfo = (id)=>{
    return Ajax({
        url:'/user/info',
        params:{id}
    })
}

const autoLogin = (token)=>{
    return Ajax({
        url:'/user/auto/login',
        method:'POST',
        data:{token}
    })
}

export {
    getvdtCode,
    userLogin,
    getUserInfo,
    autoLogin
}